package com.cisetech.web.bobocai.houtai;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cisetech.service.CodeService;
import com.cisetech.vo.bobocai.CodeVo;
/*
 * code表操作控制器
 */
@Controller
@RequestMapping(value="/code")
public class Codecontroller {
	@Autowired
	CodeService codeService;
	
	@RequestMapping(value="/addcode",method=RequestMethod.GET)
	public String addCode(Model model,HttpServletRequest request, HttpServletResponse response){
		
		
		return "houtai/addcode";
	}
	
	
	@ResponseBody
	@RequestMapping(value="/addcode",method=RequestMethod.POST)
	public String addCodes(CodeVo codeVo,HttpServletRequest request, HttpServletResponse response){
		int state = codeService.addCode(codeVo);
		
		return state+"";
	}
	
}
